<?php
require(dirname(__FILE__)."/../inc/common.inc.php");
admin(0);
if($_POST['submits']){
	if(!$pw1 || !$pw2 || !$pw3){
		showerr('请输入完整');
	}
	if($pw2!=$pw3){
		showerr('两次密码不一样');
	}
	
	if($db->get_one("select u_id from {$pre}admin where `u_name`='".$_SESSION[$webdb['session_admin']]."' and `u_pass`='".md5($pw1)."'")){
		$db->query("update {$pre}admin set `u_pass`='".md5($pw2)."' where `u_name`='".$_SESSION[$webdb['session_admin']]."'");
		logo('修改密码');
		refreshto('?','修改成功!',2);	
	}else{
		showerr('原始密码不正确');
	}
}

?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="js/html5.js"></script>
<script type="text/javascript" src="js/respond.min.js"></script>
<script type="text/javascript" src="js/PIE_IE678.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="css/H-ui.css"/>
<link type="text/css" rel="stylesheet" href="css/H-ui.admin.css"/>
<link type="text/css" rel="stylesheet" href="font/font-awesome.min.css"/>
<!--[if IE 7]>
<link href="font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<title>角色管理</title>
</head>
<body>

<div class="pd-20">
  <div class="Huiform">
  <table class="table table-border table-bordered table-bg">

<form method="post" name="df">

  <tr>
    
    <td width="234" height="20" align="center" bgcolor="#FFFFFF">原密码：</td>
    
    <td width="1356" height="20" bgcolor="#FFFFFF"><input type="password" name="pw1" class="input-text" /></td>
    
  </tr>

  <tr>

    <td height="20" align="center" bgcolor="#FFFFFF">新密码：</td>

    <td height="20" bgcolor="#FFFFFF"><input type="password" name="pw2" class="input-text" /></td>

  </tr>

  <tr>

    <td height="20" align="center" bgcolor="#FFFFFF">确认码： </td>

    <td height="20" bgcolor="#FFFFFF"><input type="password" name="pw3" class="input-text" /></td>

  </tr>

  <tr>

    <td height="20" colspan="2" align="center" bgcolor="#FFFFFF"><input class="btn btn-success radius" type="submit" value="修改" name="submits" /></td>

  </tr>

  </form>

</table>
</div>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="layer/layer.min.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script>

</body>
</html>